<?php


namespace app\api\controller\meet;


use app\common\controller\Api;
use app\common\model\AddressModel;
use app\common\model\meet\Store as StoreModel;
use think\Request;

class Store extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];
    /**
     * @var Store
     */
    private StoreModel $model;

    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->model = new StoreModel();
    }

    public function getListByCityName($cityName){
        $addressModel =new  AddressModel;
        $addressId = $addressModel->where("name",'=',$cityName)->column("id");
        if ($addressId&&$addressId[0]){
            $dataList = $this->model->where("city_id",'=',$addressId[0])->select();
            return json(['status'=>1,'data'=>$dataList]);
        }else{
            return json(['status'=>0,'info'=>'没找到地址ID']);
        }
    }
    public function testGit(){
        echo "123";
    }
}